const mongoose = require('mongoose')

const commentSchema = new mongoose.Schema({
    name:{
        type: String, math: /^[a-zA-Z][a-zA-Z0-9_]+$/
    },
    email:{
        type: String,math:/^[a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+$/
    },
    comment:{
        type: String, maxlength: 256
    },
    imageid:{
        type: mongoose.Schema.Types.ObjectId
    }
},{timestamps: true})

mongoose.model('Comment',commentSchema,'comments')